<?php	
include "../functions.php";
try{
   $pdo = new Pdo("mysql:host=localhost;dbname=c70","root","admin888");
   //字符集
   $pdo->query("set names utf8");
   //设置错误
   $pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
   //执行sql
   $sth = $pdo->prepare("update stu set name='老宋' where sid=?");
   //参数绑定
   $sid = 9;
   $sth->bindParam(1,$sid,PDO::PARAM_INT);
   //执行
   $rows = $sth->execute();
   var_dump($rows);
}catch(PDOException $e){
    echo $e->getMessage();exit;
}
















